cc.Class({
    extends: cc.Component,

    properties: {
        lock: cc.Sprite,
        titlepng: cc.Sprite,
        title: cc.Node,
        AllSelect: cc.SpriteAtlas,

    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},
    onEnable() {

    },
    init(data, id) {
        this.id = id;
        this.lock.getComponent(cc.Sprite).spriteFrame = this.AllSelect.getSpriteFrame(data.lock);
        this.titlepng.getComponent(cc.Sprite).spriteFrame = this.AllSelect.getSpriteFrame(data.mode);
        this.title.string = data.title;
    },

    start() {

    },
    selectBtn(evt) {
        let _name = evt.currentTarget.name;
        switch (_name) {
            case "select_item":
                cc.director.loadScene("game_play");
                break;
            case "tip_btn":
                var _event = new cc.Event.EventCustom('select_tip', true);
                _event.detail = {
                    id: this.id,
                };
                this.node.dispatchEvent(_event);
                break;

        }

    },
    // update (dt) {},
});
